package com.fc.mall.portal.config;

import ma.glasnost.orika.MapperFacade;
import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.impl.DefaultMapperFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PortalConfig {

    @Bean(name = "mapperFacade")
    public MapperFacade mapperFacade() {
        MapperFactory factory = new DefaultMapperFactory.Builder()
                .useAutoMapping(true).mapNulls(false).build();
        MapperFacade facade = factory.getMapperFacade();
        return facade;
    }
}
